"""
工作台页面
"""

from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class WorkbenchPage(BasePage):
    url = '/crm/index.php'
    workbench_locator = (By.XPATH, '/html/body/div[5]/div[1]/ul/li[2]/a')
    agenda_locator = (By.XPATH, '//*[@id="calendar"]/div[2]/div[2]/div[1]/a/i')
    announcement_locator = (By.XPATH, '//*[@id="widgets"]/div/div[2]/div/div[1]/a')
    notes_locator = (By.ID, 'notepad')
    click_F5_locator = (By.XPATH,'/html/body/div[5]/div[2]/p/span')
    job_locator = (By.XPATH,'/html/body/div[5]/div[1]/ul/li[1]/a')

    #点击仪表盘
    def click_workbench(self):
        self.driver.find_element(*self.workbench_locator).click()

    #点击日程快捷键
    def click_agenda(self):
        self.driver.find_element(*self.agenda_locator).click()

    #点击公告快捷键
    def click_bulletin(self):
        self.driver.find_element(*self.announcement_locator).click()

    #清除便签内容
    def clear_notes(self):
        self.driver.find_element(*self.notes_locator).clear()

    #输入便签内容
    def input_notes(self,content):
        self.driver.find_element(*self.notes_locator).send_keys(content)

    #断言输入内容一致
    def notes_ok(self):
        return self.driver.find_element(*self.notes_locator).text

    #点击工作动态
    def click_job(self):
        self.driver.find_element(*self.job_locator).click()



